/**
 * 路由索引
 * @module routes/index
 */

const express = require('express');
const router = express.Router();

const authRoutes = require('./authRoutes');
const articleRoutes = require('./articleRoutes');
const categoryRoutes = require('./categoryRoutes');
const commentRoutes = require('./commentRoutes');
const messageRoutes = require('./messageRoutes');
const uploadRoutes = require('./uploadRoutes');

// API路由
router.use('/auth', authRoutes);
router.use('/articles', articleRoutes);
router.use('/categories', categoryRoutes);
router.use('/comments', commentRoutes);
router.use('/contact', messageRoutes);
router.use('/upload', uploadRoutes);

// API健康检查
router.get('/health', (req, res) => {
  res.status(200).json({ status: 'ok', message: '服务正常运行' });
});

module.exports = router; 